﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title></title>
  <!-- Bootstrap Styles-->
  <link rel="stylesheet" type="text/css" th:href="@{/static/assets/css/bootstrap.css}"/>
  <!-- FontAwesome Styles-->
  <link rel="stylesheet" type="text/css" th:href="@{/static/assets/css/font-awesome.css}"/>
  <!-- Custom Styles-->
  <link rel="stylesheet" type="text/css" th:href="@{/static/assets/css/custom-styles.css}"/>
  <!--time-->
  <link rel="stylesheet" type="text/css"
        th:href="@{/static/assets/bootstrap-datetime/bootstrap-datetimepicker.min.css}"/>
  <!-- Google Fonts-->
  <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'/>
  <!-- TABLE STYLES-->
  <link th:href="@{/static/assets/js/dataTables/dataTables.bootstrap.css}" rel="stylesheet"/>
</head>
<body>
<div id="wrapper">
  <nav class="navbar navbar-default top-navbar" role="navigation">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse"
              data-target=".sidebar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="index.do"><i class="fa fa-gear"></i>
        <strong>后台管理系统</strong></a>
    </div>

    <ul class="nav navbar-top-links navbar-right">
      <li class="dropdown">
        <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
          <i class="fa fa-envelope fa-fw"></i> <i class="fa fa-caret-down"></i>
        </a>
        <ul class="dropdown-menu dropdown-messages">
          <li>
            <a href="#">
              <div>
                <strong>John Doe</strong>
                <span class="pull-right text-muted">
                                        <em>Today</em>
                                    </span>
              </div>
              <div>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s...
              </div>
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a href="#">
              <div>
                <strong>John Smith</strong>
                <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
              </div>
              <div>Lorem Ipsum has been the industry's standard dummy text ever since an kwilnw...
              </div>
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a href="#">
              <div>
                <strong>John Smith</strong>
                <span class="pull-right text-muted">
                                        <em>Yesterday</em>
                                    </span>
              </div>
              <div>Lorem Ipsum has been the industry's standard dummy text ever since the...</div>
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a class="text-center" href="#">
              <strong>Read All Messages</strong>
              <i class="fa fa-angle-right"></i>
            </a>
          </li>
        </ul>
        <!-- /.dropdown-messages -->
      </li>
      <!-- /.dropdown -->
      <li class="dropdown">
        <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
          <i class="fa fa-tasks fa-fw"></i> <i class="fa fa-caret-down"></i>
        </a>
        <ul class="dropdown-menu dropdown-tasks">
          <li>
            <a href="#">
              <div>
                <p>
                  <strong>Task 1</strong>
                  <span class="pull-right text-muted">60% Complete</span>
                </p>
                <div class="progress progress-striped active">
                  <div class="progress-bar progress-bar-success" role="progressbar"
                       aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
                    <span class="sr-only">60% Complete (success)</span>
                  </div>
                </div>
              </div>
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a href="#">
              <div>
                <p>
                  <strong>Task 2</strong>
                  <span class="pull-right text-muted">28% Complete</span>
                </p>
                <div class="progress progress-striped active">
                  <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="28"
                       aria-valuemin="0" aria-valuemax="100" style="width: 28%">
                    <span class="sr-only">28% Complete</span>
                  </div>
                </div>
              </div>
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a href="#">
              <div>
                <p>
                  <strong>Task 3</strong>
                  <span class="pull-right text-muted">60% Complete</span>
                </p>
                <div class="progress progress-striped active">
                  <div class="progress-bar progress-bar-warning" role="progressbar"
                       aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
                    <span class="sr-only">60% Complete (warning)</span>
                  </div>
                </div>
              </div>
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a href="#">
              <div>
                <p>
                  <strong>Task 4</strong>
                  <span class="pull-right text-muted">85% Complete</span>
                </p>
                <div class="progress progress-striped active">
                  <div class="progress-bar progress-bar-danger" role="progressbar"
                       aria-valuenow="85" aria-valuemin="0" aria-valuemax="100" style="width: 85%">
                    <span class="sr-only">85% Complete (danger)</span>
                  </div>
                </div>
              </div>
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a class="text-center" href="#">
              <strong>See All Tasks</strong>
              <i class="fa fa-angle-right"></i>
            </a>
          </li>
        </ul>
        <!-- /.dropdown-tasks -->
      </li>
      <!-- /.dropdown -->
      <li class="dropdown">
        <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
          <i class="fa fa-bell fa-fw"></i> <i class="fa fa-caret-down"></i>
        </a>
        <ul class="dropdown-menu dropdown-alerts">
          <li>
            <a href="#">
              <div>
                <i class="fa fa-comment fa-fw"></i> New Comment
                <span class="pull-right text-muted small">4 min</span>
              </div>
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a href="#">
              <div>
                <i class="fa fa-twitter fa-fw"></i> 3 New Followers
                <span class="pull-right text-muted small">12 min</span>
              </div>
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a href="#">
              <div>
                <i class="fa fa-envelope fa-fw"></i> Message Sent
                <span class="pull-right text-muted small">4 min</span>
              </div>
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a href="#">
              <div>
                <i class="fa fa-tasks fa-fw"></i> New Task
                <span class="pull-right text-muted small">4 min</span>
              </div>
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a href="#">
              <div>
                <i class="fa fa-upload fa-fw"></i> Server Rebooted
                <span class="pull-right text-muted small">4 min</span>
              </div>
            </a>
          </li>
          <li class="divider"></li>
          <li>
            <a class="text-center" href="#">
              <strong>See All Alerts</strong>
              <i class="fa fa-angle-right"></i>
            </a>
          </li>
        </ul>
        <!-- /.dropdown-alerts -->
      </li>
      <!-- /.dropdown -->
      <li class="dropdown">
        <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
          <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
        </a>
        <ul class="dropdown-menu dropdown-user">
          <li><a href="/manage/user//to_register.do"><i class="fa fa-sign-out fa-fw"></i> 用户注册</a>
          </li>
          <li><a href="/manage/user//to_login.do"><i class="fa fa-sign-out fa-fw"></i> 用户登录</a>
          </li>
          <li><a href="#"><i class="fa fa-user fa-fw"></i>用户概况</a>
          </li>
          <li><a href="#"><i class="fa fa-gear fa-fw"></i> 用户设置</a>
          </li>
          <li class="divider"></li>
          <li>
            <!--<a href="/manage/user/do_logout.do"><i class="fa fa-sign-out fa-fw"></i> 退出登录</a>-->
            <button type="button" id="logout" class="btn btn-default">退出登录</button>
          </li>
        </ul>
        <!-- /.dropdown-user -->
      </li>
      <!-- /.dropdown -->
    </ul>
  </nav>
  <!--/. NAV TOP  -->
  <nav class="navbar-default navbar-side" role="navigation">
    <div class="sidebar-collapse">
      <ul class="nav" id="main-menu">
        <li>
          <a href="../../index.do"><i class="fa fa-dashboard"></i> 概览</a>
        </li>

        <li>
          <a href="../../table.do"><i class="fa fa-table"></i> 店铺管理</a>
        </li>

        <li>
          <a href="/manage/buyer/to_list.do"><i class="fa fa-table"></i> 微客管理</a>
        </li>

        <li>
          <a class="active-menu" href="/manage/task/to_list.do"><i class="fa fa-table"></i> 任务管理</a>
        </li>

        <li>
          <a href="/manage/money/to_list.do"><i class="fa fa-table"></i> 商家充值明细</a>
        </li>

        <li>
          <a  href="/manage/message/to_message.do"><i class="fa fa-table"></i> 公告管理</a>
        </li>

        <li>
          <a  href="/manage/user/to_list.do"><i class="fa fa-table"></i> 用户管理</a>
        </li>

        <!--<li>
          <a href="ui-elements.do"><i class="fa fa-desktop"></i> UI图标</a>
        </li>
        <li>
          <a href="chart.do"><i class="fa fa-bar-chart-o"></i> 图形</a>
        </li>
        <li>
          <a href="tab-panel.do"><i class="fa fa-qrcode"></i> Tabs & Panels切换框</a>
        </li>

        <li>
          <a href="form.do"><i class="fa fa-edit"></i> Forms表单 </a>
        </li>-->
      </ul>
    </div>

  </nav>
  <!-- /. NAV SIDE  -->
  <div id="page-wrapper">
    <div id="page-inner">
      <div class="row">
        <div class="col-md-12">
          <h1 class="page-header">
            任务管理</small>
          </h1>
        </div>
      </div>
      <!-- /. ROW  -->
      <div class="row">
        <div class="col-md-12">
          <!-- Advanced Tables -->
          <div class="panel panel-default">
            <div class="panel-heading">
            </div>
            <div class="panel-body">
              <div class="table-responsive">
                <table class="table table-striped table-bordered table-hover" id="dataTables">

                  <div class="form-group">
                    <label>商品名称</label>
                    <input class="form-control" id="staskName" placeholder="请输入商品名称" name="staskName">
                    <label>任务id</label>
                    <input class="form-control" id="sid" placeholder="请输入任务id"
                           name="sid">
                    <label>任务类型</label>
                    <input class="form-control" id="staskType"  name="staskType">
                    <select id="queryTypeOption" font-size="x-large"
                            data-live-search="true" th:align="center">
                      <option data-tokens="ketchup mustard" name="status" value="-100">全部</option>
                      <option data-tokens="ketchup mustard" name="status" value="1">淘宝天猫</option>
                      <option data-tokens="ketchup mustard" name="status" value="2">定向任务</option>
                    </select>
                  </div>
                  <div class="form-group">
                    <label>店铺名称</label>
                    <input class="form-control" id="sshopName" placeholder="请输入店铺名称" name="sshopName">
                  </div>
                  <div>
                    <label>创建时间</label>
                    <a class='input-group date' id='datetimepicker1'
                       style="float: left; left: 320px;">
                      <input type='text' class="form-control" id='beginDate'
                             style="width: 150px; height: 30px;"/>
                      <span class="input-group-addon"
                            style="float: left; width: 50px; height: 30px;">
                        <span class="glyphicon glyphicon-calendar"></span>
                      </span>
                    </a>
                    <label>到</label>
                    <a class='input-group date' id='datetimepicker2'
                       style="float: left; left: 320px;">
                      <input type='text' class="form-control" id='endDate'
                             style="width: 150px; height: 30px;"/>
                      <span class="input-group-addon"
                            style="float: left; width: 50px; height: 30px;">
                        <span class="glyphicon glyphicon-calendar"></span>
                      </span>
                    </a>
                  </div>
                  <div>
                    <label>任务状态</label>
                    <select id="queryOption" font-size="x-large"
                            data-live-search="true" th:align="center">
                      <option data-tokens="ketchup mustard" name="status" value="-100">全部</option>
                      <option data-tokens="ketchup mustard" name="status" value="0">未付款</option>
                      <option data-tokens="ketchup mustard" name="status" value="1">待审核</option>
                      <option data-tokens="ketchup mustard" name="status" value="2">执行中</option>
                      <option data-tokens="ketchup mustard" name="status" value="3">完成</option>
                      <option data-tokens="ketchup mustard" name="status" value="4">过期</option>
                      <option data-tokens="mustard" name="status" value="100">未通过</option>
                    </select>
                  </div>
                  <button type="button" id="submit_Serch" class="btn btn-default"><span
                      class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>搜索
                  </button>
                </table>
              </div>
            </div>
          </div>
          <!--End Advanced Tables -->
        </div>
      </div>

    </div>
    <!--关键字弹框 start-->
     <div class="modal fade" id="myKeyModal" tabindex="-1" role="dialog"
         aria-labelledby="myKeyModalLabel">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="myKeyModalLabel">审核身份证</h4>
          </div>
          <div class="modal-body" id="content">

          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" data-dismiss="modal"><span
                class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭
            </button>
          </div>
        </div>
      </div>
     </div>
      <!--关键字弹框 end-->


      <!--详情弹框 start-->
       <div class="modal fade" id="myDetailModal" tabindex="-1" role="dialog"
           aria-labelledby="myDetailModalLabel">
        <div class="modal-dialog" role="document">
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                  aria-hidden="true">&times;</span></button>
              <h4 class="modal-title" id="myDetailModalLabel">任务详情</h4>
            </div>
            <div class="modal-body">
              <div class="form-group">
                <label>创建时间</label>
                <input type="text" name="createTime" class="form-control" id="createTime">
              </div>
              <div class="form-group">
                <label>任务id</label>
                <input type="text" name="taskIds" class="form-control" id="taskIds">
              </div>
              <div class="form-group">
                <label>任务类型</label>
                <input type="text" name="taskType" class="form-control" id="taskType">
              </div>
              <div class="form-group">
                <label>商品名称</label>
                <input type="text" name="taskName" class="form-control" id="taskName">
              </div>
              <div class="form-group">
                <label>商品id/链接</label>
                <input type="text" name="taobaoItemUrl" class="form-control" id="taobaoItemUrl">
              </div>
              <div class="form-group">
                <label>商品主图</label>
                <!--<input type="text" name="mainPicUrl" class="form-control" id="mainPicUrl">-->
                <img src="" class="img-responsive" name="mainPicUrl" id="mainPicUrl" alt="Cinque Terre" width="40" height="40">
              </div>
              <div class="form-group">
                <label>单品实际成交价格</label>
                <input type="text" name="price" class="form-control" id="price">
              </div>
              <div class="form-group">
                <label>手机搜索页面展示价格</label>
                <input type="text" name="price2" class="form-control" id="price2">
              </div>
              <div class="form-group">
                <label>任务赏金</label>
                <input type="text" name="moneyReback" class="form-control" id="moneyReback">
              </div>
              <div class="form-group">
                <label>任务加赏</label>
                <input type="text" name="extraReward" class="form-control" id="extraReward">
              </div>
              <div class="form-group">
                <label>任务开始</label>
                <input type="text" name="startTime" class="form-control" id="startTime">
              </div>
              <div class="form-group">
                <label>任务结束</label>
                <input type="text" name="endTime" class="form-control" id="endTime">
              </div>
              <div class="form-group">
                <label>任务时间上限</label>
                <input type="text" name="taskLimit" class="form-control" id="taskLimit">
              </div>
              <div class="form-group">
                <label>每个任务拍</label>
                <input type="text" name="buyAmount" class="form-control" id="buyAmount">
              </div>
              <div class="form-group">
                <label>操作视频</label>
                <input type="text" name="videoUrl" class="form-control" id="videoUrl">
              </div>
              <div class="form-group">
                <label>任务状态</label>
                <input type="text" name="status" class="form-control" id="status">
              </div>
              <div class="form-group">
                <label>商家名称</label>
                <input type="text" name="shopName" class="form-control" id="shopName">
              </div>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal"><span
                  class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭
              </button>
            </div>
          </div>
        </div>
       </div>
        <!-- 详情弹框 end-->

        <!--审核弹框 start-->
        <div class="modal fade" id="myTaskModal" tabindex="-1" role="dialog"
             aria-labelledby="myTaskModalLabel">
          <div class="modal-dialog" role="document">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                    aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myTaskModalLabel">审核</h4>
              </div>
              <div class="modal-body">
                <div class="form-group" hidden="hidden">
                  <input class="form-control" placeholder="ctaskId" name="ctaskId" id="ctaskId">
                </div>
                <div class="form-group" th:align="center">
                  <label th:align="center">店铺审核</label>
                  <select id="queryDevice" class="selectpicker" font-size="x-large"
                          data-live-search="true" th:align="center">
                    <option data-tokens="ketchup mustard" name="status" value="2">通过</option>
                    <option data-tokens="mustard" name="status" value="100">不通过</option>
                  </select>
                </div>
                <div class="form-group" th:align="center">
                  <label th:align="center">不通过原因</label>
                  <input type="text" name="noPassReason"  class="form-control" id="noPassReason"
                         placeholder="不通过原因">
                </div>
              </div>
              <div class="modal-footer">
                <button type="button" id="btn_task_submit" class="btn btn-primary"
                        data-dismiss="modal">
                  <span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>确定
                </button>
                <button type="button" class="btn btn-default" data-dismiss="modal"><span
                    class="glyphicon glyphicon-remove" aria-hidden="true"></span>取消
                </button>
              </div>
            </div>
          </div>
        </div>
        <!--审核弹框 end-->


        <footer><p>Copyright &copy; 2016.Company name All rights reserved.More Templates <a
            href="http://www.bao.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a
            href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a></p></footer>
      </div>
      <!-- /. PAGE INNER  -->
    </div>
    <!-- /. PAGE WRAPPER  -->
    <!-- /. WRAPPER  -->
    <!-- JS Scripts-->
    <!-- jQuery Js -->
    <script type="text/javascript" th:src="@{/static/assets/js/jquery-1.10.2.js}"></script>
    <!-- Bootstrap Js -->
    <script type="text/javascript" th:src="@{/static/assets/js/bootstrap.min.js}"></script>
    <!-- Metis Menu Js -->
    <script type="text/javascript" th:src="@{/static/assets/js/jquery.metisMenu.js}"></script>
    <!-- DATA TABLE SCRIPTS -->
    <script type="text/javascript" th:src="@{/static/assets/js/dataTables/jquery.dataTables.js}"></script>
    <script type="text/javascript"
            th:src="@{/static/assets/js/dataTables/dataTables.bootstrap.js}"></script>
    <script type="text/javascript"
            th:src="@{/static/assets/bootstrap-datetime/bootstrap-datetimepicker.min.js}"></script>
    <script type="text/javascript"
            th:src="@{/static/assets/bootstrap-datetime/bootstrap-datetimepicker.zh-CN.js}"></script>
    <script type="text/javascript"
            th:src="@{/static/assets/bootstrap-datetime/moment-with-locales.js}"></script>
    <script type="text/javascript"
            th:src="@{/static/js/plugins/bootstrap-table/bootstrap-table.min.js}"></script>
    <script type="text/javascript"
            th:src="@{/static/js/plugins/bootstrap-table/bootstrap-table-zh-CN.min.js}"></script>
    <script>
      $(document).ready(function () {
        $('#dataTables').bootstrapTable({
          method: 'post',
          contentType: "application/x-www-form-urlencoded",
          url: "/manage/task/lists.do",
          dataField: "data",
          pageNumber: 1, //初始化加载第一页，默认第一页
          pagination: true,//是否分页
          queryParamsType: 'limit',
          sidePagination: 'client',
          pageSize: 10,//单页记录数
          pageList: [5, 10, 20, 30],//分页步进值
          showRefresh: false,//刷新按钮
          showColumns: false,
          clickToSelect: true,//是否启用点击选中行
          toolbarAlign: 'right',
          buttonsAlign: 'right',//按钮对齐方式
          columns: [
            {
              title: '全选',
              field: 'select',
              checkbox: true,
              width: 25,
              align: 'center',
              valign: 'middle'
            },
            {
              title: '创建时间',
              field: 'createTime',
              sortable: true,
              formatter:function (value,row,index) {
                if(row.createTime == null){
                  return '暂无图片';
                }else{
                  var d = new Date(row.createTime);
                  var createTime=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
                  return createTime;
                }
              }
            },
            {
              title: '任务id',
              field: 'id',
            },
            {
              title: '任务类型',
              field: 'taskType',
            },
            {
              title: '商品名称',
              field: 'taskName',
              align: 'center',
            },
            {
              title: '商品id/链接',
              field: 'taobaoItemUrl',
              align: 'center',
            },
            {
              title: '商品主图',
              field: 'mainPicUrl',
              formatter:function (value,row,index) {
                if(row.mainPicUrl == null){
                  return '暂无图片';
                }else{
                  return '<img src="'+row.mainPicUrl+'" class="img-responsive" alt="Cinque Terre" width="40" height="40"> ';
                }
              }
            },
            {
              title: '单品实际成交价格',
              field: 'price',
              sortable: true
            },
            {
              title: '手机搜索页面展示价格',
              field: 'price2',
              sortable: true
            },
            {
              title: '任务赏金',
              field: 'moneyReback',
              sortable: true
            },
            {
              title: '任务加赏',
              field: 'extraReward',
              sortable: true
            },
            {
              title: '关键词',
              align: 'center',
              events: operateEvents,
              formatter: operateForKeys
            },
            {
              title: '任务开始',
              field: 'startTime',
              sortable: true,
              formatter:function (value,row,index) {
                if(row.startTime == null){
                  return '暂无任务开始';
                }else{
                  var d = new Date(row.startTime);
                  var startTime=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
                  return startTime;
                }
              }
            },
            {
              title: '任务结束',
              field: 'endTime',
              sortable: true,
              formatter:function (value,row,index) {
                if(row.endTime == null){
                  return '暂无任务结束';
                }else{
                  var d = new Date(row.endTime);
                  var endTime=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
                  return endTime;
                }
              }
            },
            {
              title: '任务时间上限',
              field: 'taskLimit',
              sortable: true
            },
            {
              title: '每个任务拍',
              field: 'buyAmount',
              sortable: true
            },
            {
              title: '任务详情',
              align: 'center',
              events: operateEvents,
              formatter: operateForDetail
            },
            {
              title: '操作视频',
              field: 'videoUrl',
              sortable: true
            },
            {
              title: '任务状态',
              field: 'status',
              sortable: true,
              formatter: operateFormatter
            },
            {
              title: '商家名称',
              field: 'shopName',
              sortable: true,
            },
            {
              title: '操作',
              align: 'center',
              events: operateEvents,
              formatter: checkTask
            }
          ],
          locale: 'zh-CN'//中文支持,
        });
      });

      function operateFormatter(value, row, index) {
        if (value == 0) {
          return '未付款'
        } else if (value == 1) {
          return '待审核'
        } else if (value == 2) {
          return '执行中'
        }else if (value == 3) {
          return '完成'
        }else if (value == 4) {
          return '过期'
        } else if (value == 100) {
          return '审核未通过';
        } else {
          return '数据错误';
        }
      };

      window.operateEvents = {

        'click #checkTask': function (e, value, row, index) {
          $("#myTaskModalLabel").text("任务审核");
          $('#myTaskModal').modal();
          $("#ctaskId").val(row.id);
        },

        'click #taskKeys': function (e, value, row, index) {
          $.ajax({
            type: "POST",
            url: "/manage/task/task_keywords.do",
            data: {
              taskId: row.id
            },
            dataType: 'JSON',
            success: function (data) {
              $("#myKeyModalLabel").text("任务关键字");
              $('#myKeyModal').modal();
              $("#content").empty();
              for (var i = 0; i < data.data.length; i++) {
               // $("#keys").val(data.data[i].taskKeywords);
               // $("#keysCount").val(data.data[i].taskAmount);
                var a = '<div class="form-group">'+
                   '<label>关键字</label>' +
                    '<input type="text" name="keys" value="'+ data.data[i].taskKeywords+'" class="form-control" id="keys">'+
                    '</div>'+
                   '<div class="form-group">' +
                   ' <label>任务数</label>' +
                    '<input type="text" name="keysCount" value="'+ data.data[i].taskAmount +'" class="form-control" id="keysCount">'
                   ' </div>'
                $("#content").append(a);
              }
              //$("#keys").val(data.data.taskKeywords);
              //$("#keysCount").val(data.data.taskAmount);
            }
          });
        },

        'click #taskDetail': function (e, value, row, index) {
          $.ajax({
            type: "POST",
            url: "/manage/task/task_detail.do",
            data: {
              taskId: row.id
            },
            dataType: 'JSON',
            success: function (data) {
              $("#myDetailModalLabel").text("任务详情");
              $('#myDetailModal').modal();
              $("#createTime").val(changeDate(data.data.createTime));
              $("#taskIds").val(data.data.id);
              $("#taskType").val(data.data.taskType);
              $("#taskName").val(data.data.taskName);
              $("#taobaoItemUrl").val(data.data.taobaoItemUrl);
              $('#mainPicUrl').attr('src',data.data.mainPicUrl);
              //$("#mainPicUrl").val(data.data.mainPicUrl);
              $("#price").val(data.data.price);
              $("#price2").val(data.data.price2);
              $("#moneyReback").val(data.data.moneyReback);
              $("#extraReward").val(data.data.extraReward);
              $("#startTime").val(changeDate(data.data.startTime));
              $("#endTime").val(changeDate(data.data.endTime));
              $("#taskLimit").val(data.data.taskLimit);
              $("#buyAmount").val(data.data.buyAmount);
              $("#videoUrl").val(data.data.videoUrl);
              $("#status").val(data.data.status);
              $("#shopName").val(data.data.shopName);
            }
          });
        }
      };

      <!-- 任务审核-->
      function checkTask(value, row, index) {
        return [
          '<button type="button" id="checkTask" class="RoleOfdelete btn btn-primary  btn-sm" style="margin-right:15px;">审核任务</button>',
        ].join('');
      }

      <!-- 查看关键字-->
      function operateForKeys(value, row, index) {
        return [
          '<button type="button" id="taskKeys" class="RoleOfdelete btn btn-primary  btn-sm" style="margin-right:15px;">查看关键字</button>',
        ].join('');
      }

      <!-- 任务详情-->
      function operateForDetail(value, row, index) {
        return [
          '<button type="button" id="taskDetail" class="RoleOfdelete btn btn-primary  btn-sm" style="margin-right:15px;">任务详情</button>',
        ].join('');
      }
    </script>

    <script type="text/javascript">
      $(function () {
        var $btn = $("#btn_task_submit");
        $btn.on(
            "click", function () {
              $.ajax({
                url: "/manage/task/check_task.do",
                data: {
                  "status": $("#queryDevice").val(),
                  "taskId": $("#ctaskId").val(),
                  "noPassReason": $("#noPassReason").val()
                },
                dataType: "json",
                type: "post",
                success: function (data) {
                  if (data.success == true) {
                    alert(data.msg)
                    location.reload();
                  } else {
                    alert(data.msg)
                  }
                }
              })
            })
      })
    </script>
    <script type="text/javascript">
      $(function () {
        var $btn = $("#submit_Serch");
        $btn.on(
            "click", function () {
              $.ajax({
                url: "/manage/task/searchLists.do",
                data: {
                  "taskName": $("#staskName").val(),
                  "id": $("#sid").val(),
                  "taskType": $("#queryTypeOption").val(),
                  "shopName": $("#sshopName").val(),
                  "beginDate": $("#beginDate").val(),
                  "endDate": $("#endDate").val(),
                  "status": $("#queryOption").val()
                },
                dataType: "json",
                type: "post",
                success: function (data) {
                  if (data.success == true) {
                    $("#dataTables").bootstrapTable('load', data);//主要是要这种写法
                  } else {
                    alert("操作成功失败！")
                  }
                }
              })
            })
      })
    </script>

    <script type="text/javascript">
      function changeDate(data) {
        if(data!=null){
          var d = new Date(data);
          var createTime=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
          return createTime;
        }else{
          return '暂无日期';
        }
      }

    </script>


    <script type="text/javascript">
      //设置日期时间控件
      $(function () {
        $('#datetimepicker1').datetimepicker({
          language: 'zh-CN',//显示中文
          format: 'yyyy-mm-dd',//显示格式
          minView: "month",//设置只显示到月份
          initialDate: new Date(),
          autoclose: true,//选中自动关闭
          todayBtn: true,//显示今日按钮
          locale: moment.locale('zh-cn')
        });
        //默认获取当前日期
        var today = new Date();
        var beginDate = (today.getFullYear()) + "-" + (today.getMonth() + 1) + "-"
            + today.getDate();
        //对日期格式进行处理
        var date = new Date(beginDate);
        var mon = date.getMonth() + 1;
        var day = date.getDate();
        var mydate = date.getFullYear() + "-" + (mon < 10 ? "0" + mon : mon) + "-" + (day < 10 ? "0"
            + day : day);
        document.getElementById("beginDate").value = mydate;
      })
    </script>

    <script type="text/javascript">
      //设置日期时间控件
      $(function () {
        $('#datetimepicker2').datetimepicker({
          language: 'zh-CN',//显示中文
          format: 'yyyy-mm-dd',//显示格式
          minView: "month",//设置只显示到月份
          initialDate: new Date(),
          autoclose: true,//选中自动关闭
          todayBtn: true,//显示今日按钮
          locale: moment.locale('zh-cn')
        });
        //默认获取当前日期
        var today = new Date();
        var endDate = (today.getFullYear()) + "-" + (today.getMonth() + 1) + "-" + today.getDate();
        //对日期格式进行处理
        var date = new Date(endDate);
        var mon = date.getMonth() + 1;
        var day = date.getDate();
        var mydate = date.getFullYear() + "-" + (mon < 10 ? "0" + mon : mon) + "-" + (day < 10 ? "0"
            + day : day);
        document.getElementById("endDate").value = mydate;
      })
    </script>
<script type="text/javascript">
  $(function () {
    var $btn = $("#logout");
    $btn.on(
        "click", function () {
          $.ajax({
            url: "/manage/user/do_logout.do",
            data: {
            },
            dataType: "json",
            type: "post",
            success: function (data) {
              if (data.success == true) {
                window.location.href = "/index.do";
              } else {
                alert(data.msg)
              }
            }
          })
        })
  })
</script>
    <!-- Custom Js -->
    <script type="text/javascript" th:src="@{/assets/js/custom-scripts.js}"></script>
</body>
</html>
